package com.htcms.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import com.htcms.bean.Message;
import com.htcms.bean.SmsSP;
import com.htcms.dao.MessageDAO;
import com.htcms.dao.SmsSPDAO;

public class SMSService {
	@Autowired
	@Qualifier("messageDAO")
	private MessageDAO messageDAO;
	
	@Autowired
	@Qualifier("smsspDAO")
	private SmsSPDAO smsspDAO;
	
	
	public MessageDAO getMessageDAO() {
		return messageDAO;
	}

	

	public SmsSPDAO getSmsspDAO() {
		return smsspDAO;
	}



	public void setSmsspDAO(SmsSPDAO smsspDAO) {
		this.smsspDAO = smsspDAO;
	}



	public void setMessageDAO(MessageDAO messageDAO) {
		this.messageDAO = messageDAO;
	}
	
	public void saveMessage(Message message){
		this.messageDAO.saveMessage(message);
		
	}
	
	public void updateSp(String userId,String password){
		SmsSP gsp=smsspDAO.getSpByUserId(userId);
		gsp.setPassword(password);
		smsspDAO.saveSp(gsp);
	}
}
